#!/bin/bash

function strcmp ()
{
    [ "$1" = "$2" ] && return 0

    [ "${1}" '<' "${2}" ] > /dev/null && return -- -1

    return 1
}

function strncmp ()
{
    if [ -z "${3}" ] || [ "${3}" -le "0" ]; then
       return 0
    fi

    if [ ${3} -ge ${#1} ] && [ ${3} -ge ${#2} ]; then
       strcmp "$1" "$2"
       return $?
    else
       s1=${1:0:$3}
       s2=${2:0:$3}
       strcmp $s1 $s2
       return $?
    fi
}




project[0]="/home/radek/projekty/testyZlecenia"

pwd=`pwd`

echo $pwd
echo ${project[0]}

strncmp $pwd ${project[0]} ${#project[0]}
echo $?



